import 'dart:io';
import 'package:flutter/material.dart';
import 'package:flutter_demo_app/recorder_wav.dart';
import 'package:flutter_demo_app/set_timeout.dart';
import 'package:flutter_demo_app/draggable_page.dart';
import 'package:flutter_demo_app/draggable_widget.dart';
import 'package:flutter_demo_app/video_preview_chewie.dart';
import 'package:flutter_demo_app/park_record.dart';



import 'package:device_info/device_info.dart';

void getDeviceInfo() async {
  DeviceInfoPlugin deviceInfo = new DeviceInfoPlugin();
  if (Platform.isIOS) {
    IosDeviceInfo iosDeviceInfo = await deviceInfo.iosInfo;
    print('Running on ${iosDeviceInfo.name}');
  } else if (Platform.isAndroid) {
    AndroidDeviceInfo androidDeviceInfo = await deviceInfo.androidInfo;
    print('Running on ${androidDeviceInfo.model}');
  }
}

class previewList extends StatefulWidget {
  @override
  State<StatefulWidget> createState() => previewListState();
}

class previewListState extends State<previewList> {
  @override
  void initState() {
    // TODO: implement initState
    super.initState();

    getDeviceInfo();
  }

  @override
  Widget build(BuildContext context) {
    // TODO: implement build

    return new Scaffold(
        appBar: new AppBar(
          backgroundColor: Colors.deepOrange,
          elevation: 0.0,
          title: new Text(
            "录播中心",
            style: new TextStyle(
                color: Colors.white,
                fontSize: 18.0,
                fontWeight: FontWeight.normal),
          ),
        ),
        body: new Column(
          children: <Widget>[
            RaisedButton(
              child: Text('录音'),
              onPressed: () {
                Navigator.push(
                    context,
                    new MaterialPageRoute(
                        builder: (context) => new recorderWavPage()));
              },
            ),
            RaisedButton(
              child: Text('延迟'),
              onPressed: () {
                Navigator.push(
                    context,
                    new MaterialPageRoute(
                        builder: (context) => new setTimeout()));
              },
            ),
            RaisedButton(
              child: Text('DraggablePage'),
              onPressed: () {
                Navigator.push(
                    context,
                    new MaterialPageRoute(
                        builder: (context) => new DraggablePage()));
              },
            ),
            RaisedButton(
              child: Text('draggableWidgetPage'),
              onPressed: () {
                Navigator.push(
                    context,
                    new MaterialPageRoute(
                        builder: (context) => new draggableWidgetPage()));
              },
            ),
            RaisedButton(
              child: Text('videoChewiePreview'),
              onPressed: () {
                Navigator.push(
                    context,
                    new MaterialPageRoute(
                        builder: (context) => new videoChewiePreview()));
              },
            ),
            RaisedButton(
              child:Text('Parking record'),
              onPressed:(){
                Navigator.push(
                    context,
                    new MaterialPageRoute(
                        builder:(context) => new ParkRecord()
                    )
                );
              },
            )
          ],
        ));
  } //
}
